﻿using System;
using System.Windows;
using Profit.Views.Interfaces;

namespace Profit.Views
{
    /// <summary>
    /// Interaction logic for PortraitView.xaml
    /// </summary>
    public partial class PortraitView : Window, IPortraitView
    {
        public PortraitView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Show a dialog view
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public bool? ShowDialog(IView parent)
        {
            this.Owner = parent as Window;
            this.WindowStartupLocation =
                parent == null
                    ? System.Windows.WindowStartupLocation.CenterScreen
                    : System.Windows.WindowStartupLocation.CenterOwner;

            return ShowDialog();
        }
    }
}
